﻿using Adnc.Infra.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace WYT.Pay.Repository.Entities
{
    /// <summary>
    /// 支付单
    /// </summary>
    [Table("pay_paymentOrder"), Comment("支付单"), Index(nameof(UserId)), Index(nameof(OrderId))]
    public class PaymentOrder : EfEntity
    {
        /// <summary>
        /// 用户Id
        /// </summary>
        [Comment("用户Id")]
        public long UserId { get; set; }

        /// <summary>
        /// 单据Id
        /// </summary>
        [Comment("关联订单ID")]
        public long OrderId { get; set; }

        /// <summary>
        /// 支付流水
        /// </summary>
        [Comment("支付流水"),MaxLength(50)]
        public string? PayNo { get; set; }

        /// <summary>
        /// 支付方式 1、微信，2、余额，3、购物金
        /// </summary>
        [Comment("支付方式 1、微信，2、余额，3、购物金")]
        public  int PayMode { get; set; }

        /// <summary>
        /// 状态 1、待支付，2、已支付，-1、取消
        /// </summary>
        [Comment("状态 1、待支付，2、已支付，-1、取消")]
        public int State { get; set; }

        /// <summary>
        /// 支付金额
        /// </summary>
        [Comment("支付金额"), Column(TypeName = "decimal(18,2)")]
        public decimal Amount { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Comment("创建时间")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 超期时间
        /// </summary>
        [Comment("超期时间")]
        public DateTime ExpirationTime { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        [Comment("支付时间")]
        public DateTime? TradeTime { get; set; }
    }
}
